import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { LoginModule } from './login/login.module';
import { LoginController } from './login/login.controller';
import { MongooseModule } from '@nestjs/mongoose';
import { Cat,login } from './login/login.field'
import { ShopController } from './shop/shop.controller';
import { ShopModule } from './shop/shop.module';
import { shopName,shop } from './shop/shop.fiele'
import { UserssionController } from './userssion/userssion.controller';
import { UserssionModule } from './userssion/userssion.module';

@Module({
  imports: [MongooseModule.forRoot('mongodb://127.0.0.1:27017/studentsList', {useNewUrlParser: true}),MongooseModule.forFeature([
    {
      name: Cat.name, 
      schema: login, // 引入对应的表
      collection: 'loginList' // 表名称
    }
  ]),MongooseModule.forFeature([
    {
      name: shopName.name, 
      schema: shop, // 引入对应的表
      collection: 'shopList' // 表名称
    }
  ]),LoginModule, ShopModule, UserssionModule,],
  controllers: [AppController,LoginController, ShopController, UserssionController],
  providers: [AppService],
})
export class AppModule {}
